package com.serviceImpl;

import com.dao.UserDao;
import com.domain.User;
import com.server.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service("userService")
public class UserServiceImpl implements UserService {

    @Resource(name="userDao")
    private UserDao userDao;

    @Override
    public User findLoginUser(String usernumber,String password) {
        return userDao.findLoginUser(usernumber,password);
    }

    @Override
    public User selectUserById(int id) { return userDao.selectUserById(id); }

    @Override
    public User selectUserByUsernumber(String usernumber) {
        return userDao.selectByUsernumber(usernumber);
    }

    @Override
    public int registerUser(User user) {
        return userDao.insertUser(user);
    }

    @Override
    public int updateUser(User user) { return userDao.updateUser(user); }

    @Override
    public int selectUserIdByName(String username) {
        return userDao.selectUserIdByName(username);
    }

}
